1. Field of the Invention
The present invention relates to a method for storing information in a memory and an apparatus therefor, and more particularly, to a method for storing guide information in which the guide information is alternately recorded in two memories in order to prevent the guide information from being damaged by a storage error in a system for storing the guide information in a memory and an apparatus therefor.
2. Description of the Related Art
The term xe2x80x9cbackupxe2x80x9d means making one or more copies of files or data for a case where original files or data are damaged. For example, in Windows 95 (Windows 95 is a registered trademark of Microsoft Co., Ltd.), a registry is a data file which includes various information items required for executing Windows 95 such as information on which video cards, modems, and sound cards are installed and information on current resolution, the current state of a window, and shapes of letters.
Windows 95 automatically makes backup files (system.da0 and user.da0) of system registry files (system.dat and user.dat) which are the most important files.
When an error occurs during the booting of Windows 95, a user should copy system.da0 and user.da0 to system.dat and user.dat in a DOS mode (DOS is a registered trademark of Microsoft Co., Ltd.)
In a general computer system, a user can access an operating system (OS) and recover files by using the backup files. However, the recovery of files in television sets, video tapes, and recorders cannot be performed by using backup files.
Even in a general computer system, it is difficult to recover files when a system goes down during the creation of the backup files, since the backup files are damaged.
For example, in the case of a digital multi-channel receiver, electric program guide (EPG) information is stored in an electrically erasable and programmable ROM (EEPROM), and a FLASH memory, etc. New information should be recorded after erasing previously recorded information due to the characteristics of a re-recordable non-volatile memory.
The EPG information can be obtained from periodically received EPG information or according to the needs of the user. Newly obtained EPG information is recorded after erasing all the EPG information stored in the non-volatile memory. When the system goes down due to a power failure or a breakdown of the power supply, both the new EPG information and the previous information may be lost. Therefore, new EPG information should be obtained.
When there are many channels, it takes much time to obtain the EPG information. During this time, the user should wait for the EPG information to be obtained.
Such a problem can be more severe in the case of a digital multi-channel receiver in a region where power supply and demand is unstable.
To solve the above problem, it is an object of the present invention to provide an improved method for safely recording information referred to by a system.
It is another object of the present invention to provide an apparatus suitable for the above method.
Accordingly, to achieve the first object, there is provided a method for storing guide information in a memory in a computer system, comprising the steps of checking whether currently referred information is recorded in a first memory, recording new guide information in a second memory when the currently referred information is recorded in the first memory, resetting a first flag showing that the first memory is effective and setting a second flag showing that a second memory is effective only after the new guide information has been completely recorded in the second memory, recording the new guide information in the first memory when the currently referred information is not recorded in the first memory, and resetting the second flag showing that the second memory is effective and setting the first flag showing that the first memory is effective.
To achieve the second object, there is provided an apparatus for storing guide information, comprising at least two memories for storing guide information, a flag storing unit for storing a flag displaying a memory in which effective guide information is stored among the memories, a recording path setting unit for determining a memory in which the guide information is to be recorded with reference to the state of the flag stored in the flag storing unit, setting the recording path so that the guide information is recorded in a second memory when a first memory is effective, and the guide information is recorded in the first memory when the second memory is effective, a recorder for recording the guide information in the memory set by the recording path setting unit, and a flag setting unit for setting the flag of the flag storing unit to show the effective state of a concerned memory only after the recording of the guide information in the memory set by the recording path setting unit has been completed.